#pragma once

// Copyright (c) 2010 Manuel Peinado Gallego <manuel.peinado@gmail.com>
// Distributed under the MIT license

// MeshEvent.h : interface of the MeshEvent and MeshListener classes
//

class Mesh;
class MeshManager;

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


class MeshEvent
{
public:
    
    enum Type
    {
        MeshRemoved,
        MeshAdded,
        MeshBufferAdded,
        MeshPropertyChanged,
        OtherType
    };

    enum 
    {
        TextureLayerAdded   = 1,
        AmbientColor        = 2,
        DiffuseColor        = 4,
        SpecularColor       = 8,
        EmissionColor       = 16,
        Shininess           = 32,
        TextureLayerProperty = 64,
        OtherProperty       = 128
    };
    typedef int Property;

    MeshEvent(Type type=OtherType, Property property_=OtherProperty)
        : type(type), property_(property_), mesh(NULL), meshBuffer(NULL)
    {
    }

    MeshManager* manager;
    Mesh* mesh;
    MeshBuffer* meshBuffer;
    int type;
    int property_;
};


class MeshListener 
{
public:
    virtual void onMeshEvent(const MeshEvent&) { }
};
